public class Thread1
{
	public static void main(String args[])
	{
		//获得主线程的引用
		Thread t = Thread.currentThread();
		//获得主线程的信息
		System.out.println("The main thread:"+t);
		t.setName("My thread");
		System.out.println("After chage name:"+t);
		//线程内容
		try
		{
			for(int i=0; i<5; i++)
			{
				System.out.println(i);
				t.sleep(2000);
			}
		}
		catch(Exception e)
		{
			System.out.println("happen exception");
		}
	}
}
